class ChangePolymorphs < ActiveRecord::Migration
  def self.up
    rename_column :edits, :item_id, :editable_id
    rename_column :edits, :item_type, :editable_type

    rename_column :favorites, :item_id, :favoritable_id
    rename_column :favorites, :item_type, :favoritable_type
    add_column :favorites, :user_id, :integer, :null => false
 
    rename_column :reviews, :item_id, :reviewable_id
    rename_column :reviews, :item_type, :reviewable_type

    rename_column :images, :item_id, :photographable_id
    rename_column :images, :item_type, :photographable_type

    add_foreign_key(:favorites, :users, :column => :user_id)
  end

  def self.down
  end
end
